home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11387 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: mail2news.demon.co.uk!dfdesign.demon.co.uk
  2. From: Dominic Feeley <dom@dfdesign.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: fflush and Visual C++
  5. Date: Sat, 23 Mar 96 18:15:01 GMT
  6. Organization: DF Designs
  7. Message-ID: <827604901snz@dfdesign.demon.co.uk>
  8. References: <4idhv5$dnv@news.mhv.net> <314b173b.71056173@nntp.ix.netcom.com> <4ifuuf$fha@solutions.solon.com> <4issod$jkf@newshost.cyberramp.net> <3152d29a.183262006@nntp.ix.netcom.com>
  9. Reply-To: dom@dfdesign.demon.co.uk
  10. X-NNTP-Posting-Host: dfdesign.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.30
  12. X-Mail2News-Path: dfdesign.demon.co.uk
  13.  
  14. In article <3152d29a.183262006@nntp.ix.netcom.com>
  15.            miker3@ix.netcom.com "Mike Rubenstein" writes:
  16. > sinan@cyberramp.net (John Noland) wrote:
  17. > > In article <4ifuuf$fha@solutions.solon.com>, seebs@solutions.solon.com says...> > >
  18. > > > The first part of this is incorrect.  fflush() may flush input buffers.
  19. > > > It may cause the program to abort.  It may do nothing. [ *** SNIP *** ]
  20. > > Sorry to keep getting myself in trouble, but...
  21. > > With Micrsoft's Visual C compiler, if the stream is open for input,
  22. > > fflush() clears the contents of the buffer.
  23. > Whoops.  You are correct.  The documentation does say that and looking
  24. > at the source I now see how this works.
  25. > Since ANSI says that calling fflush() with an input stream results in
  26. > undefined behavior (as I and Pete have pointed out), the compler could
  27. > do anything in this case and be ANSI compliant.
  28.  
  29. Don't forget that the result of a call to a function that invokes
  30. undefined behaviour includes the function doing what you expect.
  31.  
  32. It may not do what you expect, or what it did last time, when you
  33. re-compile on another platform, or even with a newer release of
  34. the compiler on the same platform.
  35.  
  36. Regards,
  37. Dominic.
  38.  
  39. -- 
  40. Dominic Feeley
  41.